export default {
	data() {
		return {
			//券码
			code: undefined
		};
	},
	methods: {
		scanCode(){
			var that = this;
			// 允许从相机和相册扫码
			uni.scanCode({
				success: function (res) {
					console.log('条码类型：' + res.scanType);
					console.log('条码内容：' + res.result);
					if(res.scanType === 'QR_CODE'){
						that.code = res.result;
						that.duihuan();
					}
				}
			});
		},
		duihuan(){
			//通过code来兑换券
		},
		goPage(url) {
			this.$tab.navigateTo(url)
		},
	}
};